{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 导入pandas\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "【例1】通过列表[2,3,5]创建Series对象s，索引是['C','h','h']，通过列表[0,3,6]创建Series对象t，索引是['c','h','h']，实现算术运算s+t。\n",
    "\n",
    "【分析】本例是对之前PPT介绍的例子的实践操作，其中对两种特殊情况的数据对齐特点已经介绍清楚。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "s = pd.Series([2,3,5],index = list(\"Chh\"))\n",
    "t = pd.Series([0,3,6],index = list('chh'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "【例2】通过列表[2,3,5]创建Series对象s，索引是['c','h','n']，通过列表[0,3,6]创建Series对象t，索引是['h','n','c'],实现算术运算s+t。\n",
    "\n",
    "【分析】本例的索引值相同，没有重复值，但顺序不一样，在实现算术运算时，会将索引值相同的对应元素进行算术运算"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "s = pd.Series([2,3,5],index = list(\"chn\"))\n",
    "t = pd.Series([0,3,6],index = list('hnc'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
